<template>

  <div class="splash-container">

    <!-- Logo图标 -->

    <div class="logo">

      <van-icon name="wap-home" color="#1989fa" size="64" />

    </div>



    <!-- 标题文本 -->

    <div class="title">医院综合管理</div>

    <div class="subtitle">More wisdom, more security</div>



    <!-- 倒计时显示 -->

    <div class="countdown">{{ countdown }}s</div>

  </div>

</template>



<script>

import { Icon } from 'vant';



export default {

  name: 'SplashView',

  components: {

    [Icon.name]: Icon

  },

  data() {

    return {

      countdown: 5,

      timer: null

    }

  },

  created() {

    this.startCountdown();

  },

  beforeDestroy() {

    if (this.timer) {

      clearInterval(this.timer);

    }

  },

  methods: {

    startCountdown() {

      this.timer = setInterval(() => {

        if (this.countdown > 0) {

          this.countdown--;

        } else {

          clearInterval(this.timer);

          // 修改为跳转到登录页面

          this.$router.replace('/login');

        }

      }, 1000);

    }

  }

}

</script>



<style scoped>

.splash-container {

  height: 100vh;

  display: flex;

  flex-direction: column;

  justify-content: center;

  align-items: center;

  background-color: #ffffff;

}



.logo {

  margin-bottom: 20px;

}



.title {

  font-size: 24px;

  font-weight: bold;

  color: #323233;

  margin-bottom: 8px;

}



.subtitle {

  font-size: 16px;

  color: #969799;

  margin-bottom: 40px;

}



.countdown {

  position: absolute;

  bottom: 40px;

  font-size: 14px;

  color: #969799;

}

</style>
